package com.yu.rpc.core.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 本地注册中心，负责对本地服务的具体实现进行保存
 */
public class LocalRegistry {
    public static final Map<String, Class<?>> map = new ConcurrentHashMap<>();

    public static void register(String name, Class<?> clazz) {
        map.put(name, clazz);
    }

    public static Class<?> get(String name) {
        return map.get(name);
    }

    public static void remove(String name) {
        map.remove(name);
    }
}
